import { BasicFetchResult, BasicPageArgs } from '@/api/model/baseModel';

export interface ResScriptManageItem {
  scriptId: string;
  scriptName: string;
  scriptCode: string;
  scriptContent: string;
  scriptType: string;
  scriptUse: string;
  cloudId: string;
  cloudType: string;
  typeUse: string;
}

export interface DictTreeItem {
  dictCode: string;
  dictName: string;
  parentCode: string;
}

export type ScriptPageParams = BasicPageArgs<ResScriptManageItem>;

export type ScriptPageListGetResultModel = BasicFetchResult<ResScriptManageItem>;

export type DictTreeItemModel = BasicFetchResult<DictTreeItem>;

export interface MessageSourceItem {
  sourceId: string;
  targetId: string;
  targetCode: string;
  parentId: string;
  parentName: string;
  sourceName: string;
  sourceTheme: string;
  sourceMainTag: string;
  sourcePeerTag: string;
  sourceExecuteOrder: string;
  cloudId: string;
  cloudType: string;
  cloudOption: string;
  sourceStatus: string;
  keyScriptId: string;
  pushPreScript: string;
  databasePreScript: string;
  keyScriptName: string;
  pushPreScriptName: string;
  databasePreScriptName: string;
}

export interface SelectItem {
  label: string;
  value: string;
}

export interface SelectGroupItem {
  label: string;
  options: SelectItem[];
}

export type MessageSourceItemList = BasicFetchResult<MessageSourceItem>;
export type MessageSourcePageParams = BasicPageArgs<MessageSourceItem>;
// 目标端
export interface MessageTargetItem {
  targetId: string;
  targetName: string;
  targetCode: string;
}

export type MessageTargetItemList = BasicFetchResult<MessageTargetItem>;
export type MessageTargetItemParams = BasicPageArgs<MessageTargetItem>;

// 字段管理
export interface FieldManageItem {
  fieldId: string;
  fieldName: string;
  fieldCode: string;
  fieldSourceId: string;
  fieldType: string;
}

export type FieldManageItemList = BasicFetchResult<FieldManageItem>;
export type FieldManageItemParams = BasicPageArgs<FieldManageItem>;

export interface FieldRelationItem {
  reflectionId: string;
  sourceFieldId: string;
  sourceFieldName: string;
  sourceFieldCode: string;
  targetFieldId: string;
  targetFieldName: string;
  targetFieldCode: string;
  sourceId: string;
  targetId: string;
  scriptId: string;
  scriptName: string;
}

export type FieldRelationItemList = BasicFetchResult<FieldRelationItem>;
export type FieldRelationItemParams = BasicPageArgs<FieldRelationItem>;
